package com.zcj.demo.utils.response;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;

/**
 * @author 68300119
 */
public final class DefaultResponse extends AbstractResponse {

	private List<?> list;
	
	private PaginationResponse pagination;

	public DefaultResponse(List<?> list, long total, int pageSize, int currentPage, final Map<String, Object> parameters) {
		this.list = Optional.ofNullable(list).orElseGet(ArrayList::new);
		this.pagination = new PaginationResponse(total, pageSize, currentPage);
	}

	public List<?> getList() {
		return list;
	}

	public PaginationResponse getPagination() {
		return pagination;
	}

	public DefaultResponse() {
	}
}
